/* Tour-only finishing layer. The existing catalog and shared settings own their styles. */
html:root body[data-page="tour"] {
  --mono-bg: #000;
  --mono-paper: #090909;
  --mono-line: #262626;
  --studio-surface: rgba(16, 16, 16, .72);
  --studio-heading: linear-gradient(115deg, #fff 20%, #999 100%);
  --studio-mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  height: auto !important;
  min-height: 100vh;
  background: #000 !important;
  font-family: "Segoe UI Variable Text", "Segoe UI", sans-serif !important;
}
/* Keep copy readable when it leaves the viewport; reserve motion for direct feedback. */
html:root body[data-page="tour"] .vx-scroll-reveal {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}
html:root.vx-light body[data-page="tour"] {
  --mono-bg: #f7f7f7;
  --mono-paper: #fff;
  --mono-line: #d6d6d6;
  --studio-surface: rgba(255, 255, 255, .88);
  --studio-heading: linear-gradient(115deg, #111 20%, #666 100%);
  background: var(--mono-bg) !important;
}
/* Ensure the interactive grid covers the full page throughout the tour with idle opacity */
html:root body[data-page="tour"] .cursor-grid {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  overflow: hidden !important;
  pointer-events: none !important;
  z-index: 1 !important;
  opacity: 0.4 !important;
  transition: opacity .35s ease !important;
  mask-image: none !important;
  -webkit-mask-image: none !important;
}

html:root body[data-page="tour"]:hover .cursor-grid,
html:root body[data-page="tour"] .cursor-grid.is-hovered {
  opacity: 1 !important;
}
html:root body[data-page="tour"] :is(h2, h3, .section-title) {
  font-family: "Segoe UI Variable Display", "Segoe UI", sans-serif !important;
  font-weight: 600 !important;
}
html:root body[data-page="tour"] .section-head {
  align-items: flex-start !important;
  text-align: left !important;
  max-width: none !important;
  margin-bottom: 36px !important;
}
html:root body[data-page="tour"] .section-title {
  font-size: clamp(2.15rem, 4.3vw, 3.8rem) !important;
  letter-spacing: -.055em !important;
  line-height: 1.08 !important;
  text-align: left !important;
  background: var(--studio-heading) !important;
  background-clip: text !important;
  -webkit-background-clip: text !important;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
}
html:root body[data-page="tour"] .section-sub { margin: 0 !important; text-align: left !important; }
html:root body[data-page="tour"] :is(.section-eyebrow, .studio-kicker, .teaser-tag) {
  font-family: var(--studio-mono) !important;
  font-size: .69rem !important;
  letter-spacing: .08em !important;
  text-transform: uppercase;
}
html:root body[data-page="tour"] #features .section-eyebrow::before,
html:root body[data-page="tour"] #scripts-teaser .section-eyebrow::before {
  display: inline !important;
  position: static;
  width: auto;
  height: auto;
  margin-right: 12px;
  color: var(--mono-muted);
  background: none;
  content: "01 /";
}
html:root body[data-page="tour"] #scripts-teaser .section-eyebrow::before { content: "02 /"; }
html:root body[data-page="tour"] #features > .features {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 12px !important;
  border: 0 !important;
  counter-reset: feature;
}
html:root body[data-page="tour"] .feature {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  counter-increment: feature;
  min-height: 235px;
  padding: 26px !important;
  border: 1px solid var(--mono-line) !important;
  border-radius: 10px !important;
  background: linear-gradient(135deg, var(--mono-paper), var(--mono-bg)) !important;
}
html:root body[data-page="tour"] .feature:nth-child(1),
html:root body[data-page="tour"] .feature:nth-child(5) { grid-column: span 2; }
html:root body[data-page="tour"] .feature::after {
  content: counter(feature, decimal-leading-zero);
  position: absolute;
  right: 22px;
  top: 24px;
  font: .65rem var(--studio-mono);
  color: var(--mono-muted);
  opacity: .6;
}
html:root body[data-page="tour"] .feature-icon { margin-bottom: 34px !important; opacity: .75; }
html:root body[data-page="tour"] .feature h3 { font-size: 1.15rem !important; letter-spacing: -.025em !important; }
html:root body[data-page="tour"] .feature p { max-width: 37ch; font-size: .9rem !important; }
html:root body[data-page="tour"] .teaser-grid { grid-template-columns: 1.4fr 1fr 1fr !important; gap: 16px !important; }
html:root body[data-page="tour"] .teaser {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-bottom: 26px !important;
  border-radius: 12px !important;
  background: var(--studio-surface) !important;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: translate 180ms var(--vx-ease), border-color 180ms ease !important;
}
html:root body[data-page="tour"] .teaser-thumb {
  height: 204px !important;
  aspect-ratio: auto !important;
  object-fit: cover;
  padding: 8px;
  margin-bottom: 22px !important;
  border-radius: 11px 11px 0 0 !important;
  background: var(--mono-bg);
}
html:root body[data-page="tour"] .teaser h3 { letter-spacing: -.03em !important; }
html:root body[data-page="tour"] .teaser p { font-size: .9rem !important; line-height: 1.65 !important; }
html:root body[data-page="tour"] :is(.feature, .teaser) > :not(.studio-light) { position: relative; z-index: 1; }
html:root body[data-page="tour"] .studio-light {
  position: absolute;
  top: 0;
  left: 0;
  width: 280px;
  height: 280px;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle, rgba(200, 210, 220, .09), transparent 70%);
  opacity: 0;
  transition: opacity 180ms ease;
}
html:root body[data-page="tour"] .studio-workbench {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: .7fr 1.3fr;
  align-items: center;
  gap: 52px;
  max-width: 1040px;
  margin: 0 auto 88px;
  padding: 40px 0 0;
}
.studio-workbench-copy h2 { margin: 18px 0; font-size: clamp(1.8rem, 3vw, 2.7rem); letter-spacing: -.05em; line-height: 1.1; }
.studio-workbench-copy p { color: var(--mono-muted); font-size: .93rem; line-height: 1.75; }
.studio-workbench-copy > a { display: inline-block; margin-top: 22px; color: var(--mono-ink); font-size: .85rem; text-underline-offset: 6px; }
.studio-terminal { min-width: 0; border: 1px solid var(--mono-line); border-radius: 12px; overflow: hidden; background: var(--mono-paper); box-shadow: 0 18px 60px #0002; }
.studio-terminal-bar { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--mono-line); color: var(--mono-muted); font: .69rem var(--studio-mono); }
.studio-terminal-format { margin-left: auto; }
.studio-terminal-mark { color: var(--mono-ink); }
.studio-release-picker { display: flex; gap: 5px; padding: 18px 18px 0; flex-wrap: wrap; }
.studio-release-picker button, .studio-copy { min-height: 44px; cursor: pointer; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--mono-muted); padding: 9px 12px; font: .72rem var(--studio-mono); }
.studio-release-picker button[aria-pressed="true"] { background: var(--mono-soft); border-color: var(--mono-line); color: var(--mono-ink); }
.studio-code-area { display: flex; gap: 18px; padding: 32px 22px; }
.studio-line-number { color: var(--mono-muted); opacity: .5; font: .75rem/1.85 var(--studio-mono); }
.studio-code-area pre { min-width: 0; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; text-align: left; background: transparent; border: 0; padding: 0; }
.studio-code-area code { font: .77rem/1.85 var(--studio-mono); color: var(--mono-ink); }
.studio-terminal-footer { display: flex; gap: 14px; align-items: center; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--mono-line); }
.studio-copy { color: var(--mono-ink); border-color: var(--mono-line); flex-shrink: 0; }
.studio-copy-status { margin-right: auto; font: .65rem/1.5 var(--studio-mono); color: var(--mono-muted); }
html:root body[data-page="tour"] :is(.teaser, .studio-copy, .studio-release-picker button, [data-studio-details]):focus-visible { outline: 2px solid var(--mono-ink); outline-offset: 4px; }
@media (hover: hover) and (pointer: fine) {
  html:root body[data-page="tour"] .teaser:hover { translate: 0 -4px; border-color: var(--mono-strong) !important; }
  html:root body[data-page="tour"] :is(.feature, .teaser):hover > .studio-light { opacity: 1; }
  .studio-copy:hover { background: var(--mono-soft); }
}
@media (max-width: 900px) {
  html:root body[data-page="tour"] #features > .features { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  html:root body[data-page="tour"] .feature:nth-child(1), html:root body[data-page="tour"] .feature:nth-child(5) { grid-column: auto; }
  html:root body[data-page="tour"] .teaser-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  html:root body[data-page="tour"] .teaser:first-child { grid-column: 1 / -1; }
  html:root body[data-page="tour"] .studio-workbench { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 600px) {
  html:root body[data-page="tour"] #features > .features, html:root body[data-page="tour"] .teaser-grid { grid-template-columns: minmax(0, 1fr) !important; }
  html:root body[data-page="tour"] .feature { min-height: 190px; padding: 24px !important; }
  html:root body[data-page="tour"] .section { padding-block: 64px !important; }
  html:root body[data-page="tour"] .studio-workbench { margin-bottom: 64px; padding-top: 12px; }
  .studio-code-area { padding: 26px 16px; gap: 12px; }
  .studio-release-picker { padding-inline: 12px; }
  .studio-terminal-footer { padding-inline: 12px; flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  html:root:not([data-reduced-motion="false"]) body[data-page="tour"] .teaser { translate: none !important; transition: border-color 120ms ease !important; }
  html:root:not([data-reduced-motion="false"]) body[data-page="tour"] .studio-light { display: none; }
}
html:root[data-reduced-motion="true"] body[data-page="tour"] .teaser { translate: none !important; transition: border-color 120ms ease !important; }
html:root[data-reduced-motion="true"] body[data-page="tour"] .studio-light { display: none; }
