/* Tour modal + phone chrome */

.tour-modal[hidden] {
  display: none !important;
}

.tour-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 0.75rem;
}

.tour-modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 55% at 20% 15%, rgba(255, 179, 0, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 20%, rgba(233, 30, 99, 0.2), transparent 52%),
    radial-gradient(ellipse 90% 60% at 50% 100%, rgba(41, 182, 246, 0.18), transparent 58%),
    rgba(14, 10, 18, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.tour-modal-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  width: min(100%, 480px);
  padding: 0.25rem 0.5rem 0.75rem;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.tour-modal-title {
  margin: 0;
  font-family: var(--font-display, Outfit, system-ui, sans-serif);
  font-weight: 700;
  font-size: clamp(1.15rem, 4vw, 1.35rem);
  letter-spacing: -0.03em;
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

.tour-modal-sub {
  margin: -0.35rem 0 0.15rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  text-align: center;
}

.tour-modal-close {
  position: absolute;
  top: -0.15rem;
  right: 0;
  z-index: 5;
  width: 2.35rem;
  height: 2.35rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #1a1520;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.tour-modal-close:hover {
  background: #fff;
  transform: scale(1.04);
}

.tour-modal-close:focus-visible {
  outline: 3px solid #29b6f6;
  outline-offset: 2px;
}

.tour-stage {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
}

.tour-nav {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    background 0.2s ease,
    transform 0.2s ease,
    opacity 0.2s ease;
}

.tour-nav svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tour-nav:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.06);
}

.tour-nav:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.tour-nav:focus-visible {
  outline: 3px solid #ffb300;
  outline-offset: 2px;
}

.tour-progress {
  margin: 0.1rem 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  text-align: center;
}

body.tour-open {
  overflow: hidden;
}

.tour-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
}

/* Real phone shell — matches hero .phone-frame */
.tour-device {
  --bezel-x: 0.36rem;
  --bezel-top: 0.55rem;
  --bezel-bottom: 0.45rem;
  --screen-radius: 1.25rem;
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  padding: var(--bezel-top) var(--bezel-x) var(--bezel-bottom);
  border-radius: calc(var(--screen-radius) + var(--bezel-x));
  background: linear-gradient(165deg, #3a3342 0%, #1a1520 55%, #0d0a10 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 0 48px rgba(233, 30, 99, 0.28),
    0 0 80px rgba(41, 182, 246, 0.15),
    0 24px 56px rgba(0, 0, 0, 0.45);
}

.tour-device::before {
  /* Slim speaker strip sits in the top bezel, not over the screenshot */
  content: "";
  position: absolute;
  z-index: 3;
  top: 0.28rem;
  left: 50%;
  width: 26%;
  height: 0.22rem;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #0a080c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  pointer-events: none;
  opacity: 0.9;
}

.tour-device::after {
  /* Side volume buttons */
  content: "";
  position: absolute;
  top: 22%;
  left: -0.13rem;
  width: 0.13rem;
  height: 16%;
  border-radius: 2px 0 0 2px;
  background: #1a1520;
  box-shadow: 0 2.4rem 0 #1a1520;
  pointer-events: none;
}

.tour-viewport {
  --tour-bg: #fff7f2;
  --tour-text: #1a1218;
  --tour-muted: #7a6670;
  --tour-accent: #e91e63;
  --tour-accent-bright: #ffb300;
  --tour-field: #efeeee;
  --tour-preview: #fffbfe;
  --tour-frost: rgba(255, 247, 242, 0.35);

  position: relative;
  width: min(340px, calc(100vw - 7.5rem), calc(min(78svh, 720px) * 1080 / 2400));
  aspect-ratio: 1080 / 2400;
  overflow: hidden;
  border-radius: var(--screen-radius);
  background: var(--tour-bg);
  touch-action: manipulation;
  user-select: none;
  isolation: isolate;
}

.tour-viewport.is-sky {
  background: linear-gradient(
    180deg,
    #ffe4ec 0%,
    #fff7f2 34%,
    #e3f5fc 72%,
    #fff3d6 100%
  );
}

.tour-confetti {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

.tour-layer {
  position: absolute;
  inset: 0;
}

/* display:* below must not defeat the hidden attribute */
.tour-layer[hidden],
.tour-share-logos[hidden],
.tour-shot-hint[hidden],
.tour-hotspot[hidden],
.tour-coach[hidden],
.tour-thought[hidden],
.tour-type-cover[hidden],
.tour-type-title-cover[hidden],
.tour-type-input[hidden],
.tour-type-title[hidden],
.tour-caret[hidden] {
  display: none !important;
}

/* Intro / interstitial / outro */
.tour-intro,
.tour-interstitial,
.tour-outro {
  z-index: 6;
  display: grid;
  place-items: center;
  padding: 2rem 1.5rem 3.75rem;
  cursor: pointer;
}

.tour-intro-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  text-align: center;
}

.tour-share-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  margin-bottom: 1.5rem;
  animation: tour-breathe 2.8s ease-in-out infinite alternate;
}

.tour-share-logos span {
  display: grid;
  place-items: center;
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 10px rgba(26, 18, 24, 0.1);
}

.tour-share-logos img {
  width: 1.35rem;
  height: 1.35rem;
  object-fit: contain;
}

.tour-msg {
  margin: 0;
  font-family: var(--font-display, Outfit, system-ui, sans-serif);
  font-weight: 500;
  font-size: clamp(1.4rem, 5.2vw, 2rem);
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: var(--tour-text);
  text-align: center;
  max-width: 16ch;
}

.tour-tap-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1.5rem;
  margin: 0;
  text-align: center;
  color: var(--tour-muted);
  font-size: 0.9rem;
  font-weight: 500;
  pointer-events: none;
  z-index: 20;
}

.tour-shot-hint {
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

.tour-line-in {
  animation: tour-slide-in 560ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes tour-slide-in {
  from {
    opacity: 0;
    transform: translateY(18%);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes tour-breathe {
  from {
    transform: scale(0.96);
  }
  to {
    transform: scale(1.04);
  }
}

/* Screenshot Fit layer */
.tour-shot {
  z-index: 4;
  background: transparent;
}

.tour-fit {
  position: absolute;
  overflow: visible;
}

.tour-shot-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  pointer-events: none;
}

.tour-blurs {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.tour-blur-region {
  position: absolute;
  background: var(--tour-frost);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.tour-scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Circular wave hotspot */
.tour-hotspot {
  position: absolute;
  z-index: 10;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.tour-wave,
.tour-core {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  pointer-events: none;
}

.tour-wave {
  border: 3px solid var(--tour-accent);
  animation: tour-wave 1.6s linear infinite;
}

.tour-wave:nth-child(1) {
  animation-delay: 0s;
  border-color: var(--tour-accent-bright);
}

.tour-wave:nth-child(2) {
  animation-delay: -0.53s;
}

.tour-wave:nth-child(3) {
  animation-delay: -1.06s;
  border-color: var(--tour-accent-bright);
}

.tour-core {
  inset: 21%;
  border: 3px solid var(--tour-accent);
  animation: tour-core 1.1s ease-in-out infinite alternate;
}

@keyframes tour-wave {
  0% {
    transform: scale(0.55);
    opacity: 0.85;
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

@keyframes tour-core {
  from {
    transform: scale(0.88);
    opacity: 0.08;
  }
  to {
    transform: scale(1.05);
    opacity: 0.95;
  }
}

/* Coach mark */
.tour-coach {
  position: absolute;
  z-index: 11;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.42s cubic-bezier(0.4, 0, 0.2, 1);
}

.tour-coach.is-on {
  opacity: 1;
}

.tour-coach-pill {
  background: var(--tour-accent);
  color: #fff;
  font-family: var(--font-display, Outfit, system-ui, sans-serif);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.25;
  padding: 0.62rem 1rem;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(26, 18, 24, 0.22);
  white-space: nowrap;
  max-width: 14rem;
  text-align: center;
}

.tour-caret {
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
}

.tour-caret-down {
  border-top: 8px solid var(--tour-accent);
}

.tour-caret-up {
  border-bottom: 8px solid var(--tour-accent);
}

.tour-coach.is-above {
  animation: tour-coach-nudge-up 1.1s ease-in-out infinite alternate;
}

.tour-coach.is-below {
  animation: tour-coach-nudge-down 1.1s ease-in-out infinite alternate;
}

@keyframes tour-coach-nudge-up {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-5px);
  }
}

@keyframes tour-coach-nudge-down {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(5px);
  }
}

/* Thought bubble */
.tour-thought {
  position: absolute;
  left: 4%;
  top: 7%;
  z-index: 12;
  width: 78%;
  padding: 0.85rem 1.05rem;
  border-radius: 1.35rem;
  background: rgba(255, 255, 255, 0.94);
  color: var(--tour-text);
  font-family: var(--font-display, Outfit, system-ui, sans-serif);
  font-weight: 600;
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.3;
  box-shadow: 0 8px 18px rgba(26, 18, 24, 0.14);
  cursor: pointer;
}

/* Typing */
.tour-type-cover,
.tour-type-title-cover,
.tour-type-input,
.tour-type-title {
  position: absolute;
  z-index: 9;
  pointer-events: none;
}

.tour-type-cover {
  background: var(--tour-field);
  border-radius: 0.35rem;
}

.tour-type-title-cover {
  background: var(--tour-preview);
}

.tour-type-input,
.tour-type-title {
  overflow: hidden;
  white-space: nowrap;
  color: #1c1b1f;
  font-family: Inter, system-ui, sans-serif;
  font-size: clamp(10px, 2.6vw, 14px);
  line-height: 1.2;
}

.tour-type-title {
  font-weight: 600;
}

@media (max-width: 420px) {
  .tour-stage {
    gap: 0.2rem;
  }

  .tour-nav {
    width: 2.15rem;
    height: 2.15rem;
  }

  .tour-viewport {
    width: min(300px, calc(100vw - 5.5rem), calc(min(72svh, 680px) * 1080 / 2400));
  }
}

@media (prefers-reduced-motion: reduce) {
  .tour-share-logos,
  .tour-wave,
  .tour-core,
  .tour-coach.is-above,
  .tour-coach.is-below,
  .tour-line-in {
    animation: none;
  }
}
