/* app/css/tour.css — First-run guided tutorial (app/js/tour.js; spec docs/tasks/tutorial/SPEC.md).
   Brutalist card on top of a dimmed page with a spotlight cut-out. Light + dark via the brutal.css tokens.
   Only transform and opacity are animated (AGENTS.md §4); nothing moves under prefers-reduced-motion. */

.tour {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
}
.tour.is-on {
  opacity: 1;
}
.tour [hidden] {
  display: none !important;
}

/* Transparent blockers around the spotlight hole (and over it on info steps): they take every click and tap. */
.tour__block {
  position: fixed;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: auto;
  background: transparent;
  touch-action: none;
}

/* Spotlight: the huge shadow dims everything except the hole. */
.tour__spot {
  position: fixed;
  left: 0;
  top: 0;
  border: 3px solid #ffd447;
  border-radius: var(--radius, 7px);
  box-shadow: 0 0 0 200vmax rgba(8, 7, 6, 0.64);
  pointer-events: none;
  transition: transform 0.32s var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
  box-sizing: border-box;
}
.tour__spot.is-center {
  border-width: 0;
}

/* Card */
.tour__card {
  position: fixed;
  left: 0;
  top: 0;
  box-sizing: border-box;
  width: min(380px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 16px 16px 14px;
  background: var(--paper, #f3f0e6);
  color: var(--ink, #111);
  border: var(--rule, 2.5px) solid var(--ink, #111);
  border-radius: var(--radius, 7px);
  box-shadow: var(--shadow, 7px 7px 0 #111);
  font-family: var(--font-display, system-ui, sans-serif);
  pointer-events: auto;
  transition: transform 0.32s var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.tour__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.tour__count {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #4d4b45);
}
.tour__card .b-btn {
  min-height: 44px;
  min-width: 44px;
}
.tour__skip {
  padding: 6px 12px;
  font-size: 14px;
  background: var(--paper-2, #e9e5d8);
  color: var(--ink, #111);
}

.tour__title {
  margin: 0 0 6px;
  font-size: 1.22rem;
  font-weight: 800;
  line-height: 1.2;
}
.tour__text {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.5;
  color: var(--ink-2, var(--ink, #111));
}
.tour__try {
  margin: 10px 0 0;
  padding: 6px 10px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  font-weight: 700;
  background: var(--fill-7, #efe2a6);
  color: #111;
  border: 2px solid var(--ink, #111);
  border-radius: var(--radius-sm, 6px);
}

.tour__dots {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 14px 0 12px;
}
.tour__dots i {
  width: 9px;
  height: 9px;
  border: 2px solid var(--ink, #111);
  border-radius: 50%;
  background: transparent;
  box-sizing: border-box;
}
.tour__dots i.is-past {
  background: var(--muted, #4d4b45);
  border-color: var(--muted, #4d4b45);
}
.tour__dots i.is-on {
  background: var(--ink, #111);
  transform: scale(1.25);
}

.tour__nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.tour__nav .b-btn {
  flex: 1 1 0;
}
.tour__back:disabled {
  opacity: 0.45;
  cursor: default;
}

/* "Try it" steps: a gentle pulse on the spotlight ring. */
.tour__card.is-try ~ .tour__live,
.tour__live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.tour__spot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 3px solid #ffd447;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
}
.tour:has(.tour__card.is-try) .tour__spot::after {
  animation: tour-pulse 1.4s var(--ease, cubic-bezier(0.22, 1, 0.36, 1)) infinite;
}
@keyframes tour-pulse {
  0% {
    opacity: 0.9;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.12);
  }
}

/* Small phones (360 px wide): a little tighter. */
@media (max-width: 400px) {
  .tour__card {
    padding: 14px 12px 12px;
  }
  .tour__title {
    font-size: 1.1rem;
  }
  .tour__text {
    font-size: 0.92rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tour,
  .tour__spot,
  .tour__card {
    transition: none;
  }
  .tour__spot::after,
  .tour:has(.tour__card.is-try) .tour__spot::after {
    animation: none;
  }
}
