/* SpaceSick — Guided Tours styling.
   Reuses the app's tokens (--serif, --sans, --accent, --text*, --bg) so the
   intro fork, surface control, tour menu, and end screen sit inside the
   existing quiet aesthetic. Loaded after css/spacesick.css. */

/* ---------- intro fork ---------- */
/* Two calm, equal choices at the end of the opening sequence. #begin remains
   the "wander" action; these rules neutralize its solo-CTA styling so it reads
   as one of a pair rather than a single loud button. */
.intro-fork {
  position: relative;
  z-index: 1;
  margin-top: clamp(34px, 6.5vh, 60px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.intro-choice {
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  color: var(--text);
  background: rgba(67, 97, 238, 0.07);
  border: 1px solid rgba(120, 130, 220, 0.32);
  border-radius: 999px;
  padding: 15px 40px;
  min-width: min(300px, 78vw);
  cursor: pointer;
  opacity: 0;
  transition: opacity 2.2s ease, border-color 0.5s ease, background 0.5s ease, box-shadow 0.5s ease;
}
.intro-choice.visible { opacity: 1; }
.intro-choice:hover {
  border-color: rgba(140, 150, 240, 0.7);
  background: rgba(67, 97, 238, 0.15);
  box-shadow: 0 0 32px rgba(67, 97, 238, 0.2);
}
/* Override #begin's louder single-CTA rules (ID specificity) so the fork is calm
   and the two options match. No pulse animation on the fork. */
#begin.intro-choice {
  margin-top: 0;
  font-size: 17px;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  padding: 15px 40px;
  animation: none;
}
#begin.intro-choice.visible { animation: none; }

/* ---------- surface: "continue the tour" control ---------- */
/* Sits inside .surface-info, between the description and the back/stranger
   actions. Hidden unless a tour is active on this exact world. */
#tour-control {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  width: 100%;
  max-width: 420px;
  margin-top: 4px;
  padding-top: 20px;
  border-top: 1px solid rgba(140, 150, 220, 0.14);
  opacity: 0;
  transition: opacity 0.6s ease;
}
#tour-control.visible { display: flex; opacity: 1; }
.tour-progress {
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.tour-continue {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(67, 97, 238, 0.14);
  border: 1px solid rgba(120, 130, 220, 0.42);
  border-radius: 999px;
  padding: 14px 30px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  transition: border-color 0.5s ease, background 0.5s ease, box-shadow 0.5s ease;
}
.tour-continue:hover {
  border-color: rgba(140, 150, 240, 0.75);
  background: rgba(67, 97, 238, 0.22);
  box-shadow: 0 0 28px rgba(67, 97, 238, 0.2);
}
.tour-continue .tc-arrow { transition: transform 0.4s ease; }
.tour-continue:hover .tc-arrow { transform: translateX(4px); }

/* ---------- shared overlay shell (menu + end screen) ---------- */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 48;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.tour-overlay.open { opacity: 1; pointer-events: auto; }
.tour-scrim {
  position: absolute;
  inset: 0;
  background: rgba(1, 3, 9, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ---------- tour menu ---------- */
.tour-panel {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100svh - 56px);
  display: flex;
  flex-direction: column;
  overflow: hidden;              /* the tour LIST scrolls; header + footer stay put */
  background: rgba(10, 14, 28, 0.94);
  border: 1px solid rgba(120, 130, 180, 0.22);
  border-radius: 20px;
  padding: 34px 30px 28px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.55s cubic-bezier(0.22, 0.8, 0.35, 1);
}
/* header (eyebrow / title / lede) and the wander link never scroll away */
.tour-panel > .tour-eyebrow,
.tour-panel > .tour-title,
.tour-panel > .tour-lede,
.tour-panel > .tour-wander { flex: 0 0 auto; }
.tour-overlay.open .tour-panel { transform: translateY(0) scale(1); }
.tour-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  color: var(--text-faint);
  background: transparent;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.4s ease, background 0.4s ease;
}
.tour-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.tour-eyebrow {
  display: block;
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.tour-title {
  margin-top: 12px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(26px, 6vw, 32px);
  letter-spacing: 0.02em;
  color: var(--text);
}
.tour-lede {
  margin-top: 10px;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-dim);
  text-wrap: pretty;
}
.tour-list {
  flex: 1 1 auto;
  min-height: 0;                 /* let the flex child shrink so it can scroll */
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-top: 22px;
  padding: 2px;                  /* keeps row borders off the scroll edge */
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tour-list::-webkit-scrollbar { display: none; }
.tour-row {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  text-align: left;
  padding: 18px 18px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(140, 150, 200, 0.16);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.4s ease, background 0.4s ease, transform 0.4s ease;
}
.tour-row:hover {
  border-color: rgba(140, 150, 240, 0.5);
  background: rgba(67, 97, 238, 0.1);
}
.tour-row:hover .tr-arrow { transform: translateX(4px); color: var(--text); }
.tr-index {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  flex-shrink: 0;
  padding-top: 3px;
}
.tr-text { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.tr-title {
  font-family: var(--serif);
  font-size: clamp(19px, 4.6vw, 22px);
  font-weight: 500;
  line-height: 1.25;
  color: var(--text);
  text-wrap: pretty;
}
.tr-desc {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-dim);
  text-wrap: pretty;
}
.tr-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.tr-count {
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}
.tr-arrow {
  font-size: 17px;
  color: var(--text-faint);
  transition: transform 0.4s ease, color 0.4s ease;
}
.tour-wander {
  flex: 0 0 auto;
  width: 100%;
  text-align: center;
  margin: 16px 0 0;
  padding-top: 16px;
  border: none;
  border-top: 1px solid rgba(140, 150, 220, 0.12);
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  background: transparent;
  cursor: pointer;
  transition: color 0.4s ease;
}
.tour-wander:hover { color: var(--text-dim); }

/* ---------- end screen ---------- */
/* A quiet full-screen bookend to the intro, centered on the starfield. */
.tour-end .tour-scrim { background: rgba(1, 3, 9, 0.9); }
.tour-end-inner {
  position: relative;
  width: min(580px, 100%);
  max-height: calc(100svh - 56px);
  overflow-y: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(16px);
  opacity: 0;
  transition: transform 0.7s cubic-bezier(0.22, 0.8, 0.35, 1), opacity 0.7s ease;
  scrollbar-width: none;
}
.tour-end-inner::-webkit-scrollbar { display: none; }
.tour-end.open .tour-end-inner { transform: translateY(0); opacity: 1; }
.tour-end-title {
  margin-top: 14px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 7vw, 40px);
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: var(--text);
  text-wrap: balance;
}
.tour-end-outro {
  margin-top: 18px;
  max-width: 480px;
  font-family: var(--serif);
  font-size: clamp(17px, 4.4vw, 21px);
  line-height: 1.6;
  color: var(--text-dim);
  text-wrap: pretty;
}

/* email capture */
.tour-sub {
  margin-top: clamp(30px, 6vh, 48px);
  width: 100%;
  max-width: 440px;
  padding-top: clamp(26px, 5vh, 40px);
  border-top: 1px solid rgba(140, 150, 220, 0.14);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.tour-sub-copy {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(16px, 4vw, 19px);
  line-height: 1.55;
  color: #9aa6e8;
  text-wrap: pretty;
}
.tour-email {
  margin-top: 20px;
  width: 100%;
  display: flex;
  gap: 10px;
}
.tour-email input {
  flex: 1;
  min-width: 0;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(140, 150, 200, 0.28);
  border-radius: 999px;
  padding: 14px 22px;
  min-height: 50px;
  transition: border-color 0.4s ease, background 0.4s ease;
}
.tour-email input::placeholder { color: var(--text-faint); }
.tour-email input:focus {
  outline: none;
  border-color: rgba(140, 150, 240, 0.7);
  background: rgba(67, 97, 238, 0.08);
}
.tour-email-btn {
  flex-shrink: 0;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(67, 97, 238, 0.18);
  border: 1px solid rgba(120, 130, 220, 0.5);
  border-radius: 999px;
  padding: 0 26px;
  min-height: 50px;
  cursor: pointer;
  transition: border-color 0.4s ease, background 0.4s ease, box-shadow 0.4s ease, opacity 0.4s ease;
}
.tour-email-btn:hover {
  border-color: rgba(140, 150, 240, 0.8);
  background: rgba(67, 97, 238, 0.28);
  box-shadow: 0 0 26px rgba(67, 97, 238, 0.22);
}
.tour-email-btn:disabled { opacity: 0.5; cursor: default; }
.tour-confirm {
  margin-top: 16px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--text);
  opacity: 0;
  transition: opacity 0.7s ease;
}
.tour-confirm.visible { opacity: 1; }
.tour-error {
  margin-top: 14px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 15.5px;
  color: rgba(232, 176, 176, 0.82); /* a quiet rose — gentle correction, not alarm */
  opacity: 0;
  transition: opacity 0.5s ease;
}
.tour-error.visible { opacity: 1; }
.tour-email.sent { display: none; } /* on confirm, retire the field; the message stands in its place */

.tour-end-actions {
  margin-top: clamp(30px, 6vh, 46px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

/* ---------- small screens ---------- */
@media (max-width: 460px) {
  .tour-panel { padding: 30px 20px 24px; border-radius: 18px; }
  .tour-row { padding: 15px 14px; gap: 12px; }
  .tr-meta { align-items: flex-end; }
  .tour-email { flex-direction: column; }
  .tour-email input, .tour-email-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .tour-overlay,
  .tour-panel,
  .tour-end-inner,
  .tour-confirm,
  .tour-error,
  #tour-control,
  .intro-choice,
  .tr-arrow,
  .tc-arrow { transition: none; }
}
