.tour-page {
  --tour-line: rgba(241, 197, 14, 0.24);
  --tour-line-muted: rgba(255, 255, 255, 0.08);
}

.tour-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(4.25rem, 8vw, 7rem) 0 clamp(4.5rem, 8vw, 7rem);
}

.tour-hero-grid {
  position: absolute;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(circle at 50% 32%, #000 12%, transparent 75%);
  mask-image: radial-gradient(circle at 50% 32%, #000 12%, transparent 75%);
}

.tour-hero-glow {
  position: absolute;
  z-index: -2;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.18;
  pointer-events: none;
  background: var(--accent);
  animation: tourGlowDrift 18s var(--ease) infinite alternate;
}

.tour-hero-glow-a { top: 2%; left: 8%; }
.tour-hero-glow-b { top: 15%; right: 5%; animation-delay: -8s; opacity: 0.1; }

@keyframes tourGlowDrift {
  from { transform: translate3d(-18px, -12px, 0) scale(0.95); }
  to { transform: translate3d(24px, 22px, 0) scale(1.08); }
}

.tour-hero-inner { max-width: 1160px; text-align: center; }
.tour-hero h1 { font-size: clamp(2.8rem, 7vw, 5rem); font-weight: 800; letter-spacing: -0.045em; }
.tour-hero .lead {
  color: var(--text-muted);
  max-width: 760px;
  margin: 1.3rem auto 0;
  font-size: clamp(1rem, 2vw, 1.18rem);
}
.tour-hero-actions {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.tour-shot-frame {
  --tour-rx: 0deg;
  --tour-ry: 0deg;
  --tour-shift: 0px;
  appearance: none;
  width: 100%;
  margin: 0;
  padding: 0;
  color: inherit;
  text-align: left;
  font: inherit;
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.018)),
    #101216;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
  cursor: zoom-in;
  transform:
    perspective(1200px)
    translate3d(0, var(--tour-shift), 0)
    rotateX(var(--tour-rx))
    rotateY(var(--tour-ry));
  transform-origin: center;
  transition:
    border-color 0.35s var(--ease),
    box-shadow 0.35s var(--ease),
    transform 0.22s var(--ease);
  will-change: transform;
}

.tour-shot-frame:hover {
  border-color: rgba(241, 197, 14, 0.34);
  box-shadow: 0 28px 85px rgba(0, 0, 0, 0.43), 0 0 0 1px rgba(241, 197, 14, 0.08);
}

.tour-shot-frame:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
  border-color: var(--accent);
}

.tour-shot-frame.is-missing { cursor: default; }
.tour-shot-frame.is-missing:hover { border-color: var(--border); }

.tour-shot-frame-hero {
  max-width: 1080px;
  margin: clamp(3rem, 6vw, 4.7rem) auto 0;
}

.tour-frame-bar {
  min-height: 48px;
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
}

.tour-frame-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.015em;
}

.tour-frame-mark {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 24px;
  padding: 0 7px;
  border: 1px solid rgba(241, 197, 14, 0.28);
  border-radius: 7px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.tour-frame-context {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-dim);
  font-size: 0.75rem;
  white-space: nowrap;
}

.tour-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(241, 197, 14, 0.35);
  animation: tourPulse 2.4s ease-in-out infinite;
}

@keyframes tourPulse {
  0%, 100% { opacity: 0.55; box-shadow: 0 0 0 0 rgba(241, 197, 14, 0); }
  50% { opacity: 1; box-shadow: 0 0 0 7px rgba(241, 197, 14, 0); }
}

.tour-shot-stage {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 20%, rgba(241, 197, 14, 0.05), transparent 38%),
    #0b0d10;
}

.tour-shot-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 1;
  transform: scale(1.005);
  transition: opacity 0.35s var(--ease), transform 0.55s var(--ease);
}

html.js .tour-shot-stage img { opacity: 0; }
html.js .tour-shot-frame.is-loaded .tour-shot-stage img { opacity: 1; }
.tour-shot-frame.is-loaded:hover .tour-shot-stage img { transform: scale(1.012); }

.tour-shot-placeholder {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.55rem;
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  background:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 32px 32px;
  transition: opacity 0.3s var(--ease);
}
.tour-shot-frame.is-loaded .tour-shot-placeholder { opacity: 0; pointer-events: none; }

.tour-shot-placeholder strong { color: var(--text-main); font-size: 0.95rem; }
.tour-shot-placeholder code {
  max-width: 100%;
  padding: 5px 9px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.035);
  color: var(--accent);
  font-size: clamp(0.66rem, 1.7vw, 0.8rem);
  overflow-wrap: anywhere;
}

.tour-placeholder-icon {
  width: 54px;
  height: 40px;
  border: 1px solid rgba(241, 197, 14, 0.35);
  border-radius: 8px;
  position: relative;
  background: rgba(241, 197, 14, 0.045);
}
.tour-placeholder-icon::before,
.tour-placeholder-icon::after {
  content: "";
  position: absolute;
  border-radius: 2px;
  background: rgba(241, 197, 14, 0.42);
}
.tour-placeholder-icon::before { left: 8px; right: 8px; bottom: 8px; height: 1px; }
.tour-placeholder-icon::after { width: 11px; height: 11px; border-radius: 50%; top: 7px; left: 9px; }

.tour-view-hint {
  position: absolute;
  right: 0.85rem;
  bottom: 0.85rem;
  z-index: 3;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 9px;
  color: #fff;
  background: rgba(8, 9, 11, 0.76);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 0.75rem;
  font-weight: 650;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}
.tour-shot-frame.is-loaded:hover .tour-view-hint,
.tour-shot-frame.is-loaded:focus-visible .tour-view-hint { opacity: 1; transform: none; }

.tour-placeholder-note {
  max-width: 720px;
  margin: 1rem auto 0;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.tour-progress-mobile {
  display: none;
  position: sticky;
  top: var(--header-h);
  z-index: 850;
  height: 2px;
  background: rgba(255,255,255,0.05);
}
.tour-progress-mobile span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(241, 197, 14, 0.36);
}

.tour-layout {
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
  padding-top: 1rem;
  padding-bottom: 4rem;
}

.tour-rail {
  position: sticky;
  top: calc(var(--header-h) + 2rem);
  align-self: start;
  padding: 1rem 0;
}

.tour-rail-card {
  position: relative;
  padding: 1rem 0 1rem 1.25rem;
}

.tour-rail-title {
  margin-bottom: 1rem;
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.tour-rail-track {
  position: absolute;
  left: 0;
  top: 3.15rem;
  bottom: 1.35rem;
  width: 1px;
  background: var(--tour-line-muted);
}
.tour-rail-track span {
  display: block;
  width: 1px;
  height: 0;
  max-height: 100%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(241, 197, 14, 0.32);
}

.tour-rail-nav { display: flex; flex-direction: column; gap: 0.25rem; }
.tour-rail-nav a {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  min-height: 34px;
  padding: 7px 8px;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 600;
  transition: color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}
.tour-rail-nav a::before {
  content: "";
  position: absolute;
  left: -1.56rem;
  top: 50%;
  width: 7px;
  height: 7px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--bg-main);
  transform: translateY(-50%);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.tour-rail-nav a span { color: var(--text-dim); font-size: 0.66rem; }
.tour-rail-nav a:hover { color: var(--text-main); background: rgba(255,255,255,0.03); }
.tour-rail-nav a.is-active {
  color: var(--accent);
  background: rgba(241, 197, 14, 0.055);
  transform: translateX(2px);
}
.tour-rail-nav a.is-active::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(241, 197, 14, 0.1);
}

.tour-story { min-width: 0; }

.tour-step {
  scroll-margin-top: calc(var(--header-h) + 2rem);
  position: relative;
  padding: clamp(5rem, 9vw, 8rem) 0;
  border-bottom: 1px solid rgba(255,255,255,0.055);
}
.tour-step:first-child { padding-top: 3.5rem; }

.tour-step::before {
  content: "";
  position: absolute;
  inset: 9% -8% auto;
  height: 58%;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(241, 197, 14, 0.04), transparent 70%);
  transition: opacity 0.65s var(--ease);
}
.tour-step.is-active::before { opacity: 1; }

.tour-step-head {
  display: grid;
  grid-template-columns: 56px minmax(0, 760px);
  gap: 1.35rem;
  align-items: start;
  margin-bottom: 2.25rem;
}
.tour-step-number {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text-dim);
  background: rgba(255,255,255,0.025);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  transition: color 0.35s var(--ease), border-color 0.35s var(--ease), background 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.tour-step.is-active .tour-step-number {
  color: var(--accent);
  border-color: rgba(241, 197, 14, 0.34);
  background: var(--accent-soft);
  box-shadow: 0 0 28px rgba(241, 197, 14, 0.07);
}

.tour-step-head .eyebrow { margin-bottom: 0.7rem; }
.tour-step-head h2 {
  font-size: clamp(1.85rem, 4.2vw, 3rem);
  letter-spacing: -0.035em;
}
.tour-step-head p {
  max-width: 720px;
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 1rem;
}
.tour-step-head code { color: var(--accent); }

.tour-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.15rem;
}
.tour-tags span {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  background: rgba(255,255,255,0.02);
  font-size: 0.74rem;
  font-weight: 600;
}

.tour-shot-frame-wide { margin-top: 0.5rem; }
.tour-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
  margin-top: 1.2rem;
}

.tour-finale { padding-bottom: 6rem; }
.tour-finale-card {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: clamp(2.5rem, 6vw, 4.5rem) 1.5rem;
  border: 1px solid rgba(241, 197, 14, 0.22);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 50% 0%, rgba(241, 197, 14, 0.095), transparent 42%),
    var(--panel);
  box-shadow: var(--shadow-soft);
}
.tour-finale-card h2 { font-size: clamp(2rem, 5vw, 3.25rem); }
.tour-finale-card p { max-width: 650px; margin: 1rem auto 0; color: var(--text-muted); }
.tour-finale-actions {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.tour-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1400;
  padding: 1.25rem;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow-y: auto;
}
.tour-lightbox.open {
  display: flex;
  align-items: center;
  justify-content: center;
}
.tour-lightbox-dialog {
  width: min(1440px, 100%);
  max-height: calc(100vh - 2.5rem);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #0c0d10;
  box-shadow: 0 30px 100px rgba(0,0,0,0.65);
  animation: tourLightboxIn 0.25s var(--ease);
}
@keyframes tourLightboxIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.tour-lightbox-topbar,
.tour-lightbox-controls {
  flex: 0 0 auto;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
}
.tour-lightbox-topbar > div { min-width: 0; display: flex; align-items: baseline; gap: 0.7rem; }
.tour-lightbox-topbar strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tour-lightbox-counter { color: var(--text-dim); font-size: 0.78rem; }
.tour-lightbox-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,0.035);
  color: #fff;
  font: inherit;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}
.tour-lightbox-close:hover,
.tour-lightbox-close:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }

.tour-lightbox-media {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  overflow: auto;
  background: #050607;
}
.tour-lightbox-media img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 10rem);
  width: auto;
  height: auto;
  object-fit: contain;
}
.tour-lightbox-controls {
  border-top: 1px solid var(--border);
  border-bottom: 0;
  justify-content: center;
}

@media (max-width: 1020px) {
  .tour-layout { grid-template-columns: 1fr; gap: 0; }
  .tour-rail { display: none; }
  .tour-progress-mobile { display: block; }
  .tour-step:first-child { padding-top: 4rem; }
}

@media (max-width: 760px) {
  .tour-hero { padding-top: 3.5rem; }
  .tour-pair { grid-template-columns: 1fr; }
  .tour-step-head { grid-template-columns: 1fr; gap: 0.85rem; }
  .tour-step-number { width: 42px; height: 42px; border-radius: 12px; }
  .tour-frame-bar { min-height: 44px; }
  .tour-frame-context { display: none; }
  .tour-shot-stage { aspect-ratio: 16 / 10; }
}

@media (max-width: 520px) {
  .tour-hero-actions,
  .tour-finale-actions { flex-direction: column; }
  .tour-hero-actions .btn,
  .tour-finale-actions .btn { width: 100%; }
  .tour-shot-placeholder { gap: 0.4rem; padding: 0.9rem; }
  .tour-placeholder-icon { width: 44px; height: 34px; }
  .tour-view-hint { display: none; }
  .tour-lightbox { padding: 0.5rem; }
  .tour-lightbox-dialog { max-height: calc(100vh - 1rem); border-radius: 14px; }
  .tour-lightbox-topbar { align-items: center; }
  .tour-lightbox-topbar > div { display: block; }
  .tour-lightbox-counter { display: block; margin-top: 2px; }
  .tour-lightbox-controls { justify-content: space-between; }
  .tour-lightbox-controls .btn { --pad-x: 13px; }
}

@media (hover: none) {
  .tour-view-hint { display: none; }
  .tour-shot-frame:hover { border-color: var(--border); box-shadow: 0 24px 70px rgba(0,0,0,0.36); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tour-hero-glow,
  .tour-live-dot { animation: none; }
  .tour-shot-frame {
    transform: none !important;
    transition: border-color 0.15s linear, box-shadow 0.15s linear;
  }
  .tour-shot-stage img,
  .tour-shot-placeholder,
  .tour-view-hint,
  .tour-step::before,
  .tour-step-number,
  .tour-rail-nav a,
  .tour-rail-nav a::before { transition-duration: 0.01ms !important; }
  .tour-lightbox-dialog { animation: none; }
}
