/* ============================================================
   TOUR CSS  —  Cinematic spotlight tour (no ghost)
   ============================================================ */

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

/* ── Trigger pill ─────────────────────────────────────────── */
.tour-trigger {
  position: fixed;
  bottom: 28px;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 10px 14px;
  background: var(--navy, #1e2a4a);
  color: #fff;
  border: none;
  border-radius: 40px;
  font-family: var(--mono, monospace);
  font-size: 12.5px;
  letter-spacing: 0.03em;
  cursor: pointer;
  z-index: 8200;
  box-shadow: 0 4px 20px rgba(30,42,74,0.3);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.tour-trigger:hover {
  background: var(--brass, #a8763e);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(30,42,74,0.35);
}

.tour-trigger-icon {
  font-size: 10px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.tour-trigger::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 40px;
  border: 2px solid rgba(168,118,62,0.4);
  animation: tour-pill-pulse 2.5s ease-out infinite;
}
.tour-trigger.no-pulse::after { display: none; }

@keyframes tour-pill-pulse {
  0%   { transform: scale(1);   opacity: 0.6; }
  70%  { transform: scale(1.1); opacity: 0; }
  100% { transform: scale(1.1); opacity: 0; }
}

/* ── Intro card ───────────────────────────────────────────── */
.tour-intro {
  position: fixed;
  bottom: 84px; left: 24px;
  width: 256px;
  background: var(--paper, #fffdf8);
  border: 1px solid var(--line, rgba(33,29,23,0.12));
  border-radius: 16px;
  padding: 22px 20px 18px;
  box-shadow: 0 16px 48px rgba(30,42,74,0.2);
  z-index: 8300;
  animation: tour-fadein 0.22s ease;
}

@keyframes tour-fadein {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tour-intro-close {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none; font-size: 18px;
  cursor: pointer; color: var(--ink-70, rgba(33,29,23,0.55));
  line-height: 1; padding: 2px 6px;
}
.tour-intro-avatar {
  display: block; width: 88px; height: 88px;
  object-fit: contain; margin: 0 auto 12px;
}
.tour-intro-title {
  font-family: var(--serif, serif);
  font-size: 18px; font-weight: 700;
  color: var(--navy, #1e2a4a);
  margin: 0 0 6px; text-align: center;
}
.tour-intro-desc {
  font-size: 13px;
  color: var(--ink-70, rgba(33,29,23,0.7));
  margin: 0 0 16px; text-align: center; line-height: 1.5;
}
.tour-intro-start {
  display: block; width: 100%; padding: 10px;
  background: var(--navy, #1e2a4a);
  color: #fff; border: none; border-radius: 8px;
  font-family: var(--mono, monospace); font-size: 13px; cursor: pointer;
  transition: background 0.18s, transform 0.15s;
}
.tour-intro-start:hover { background: var(--brass, #a8763e); transform: scale(1.02); }

/* ── Click blocker + cinematic overlay ───────────────────── */
.tour-blocker {
  position: fixed; inset: 0;
  z-index: 9000;
  cursor: default;
}

/* Scanline texture on the dimmed area — subtle film feel */
.tour-blocker::after {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 3px,
    rgba(0,0,0,0.025) 3px, rgba(0,0,0,0.025) 4px
  );
  pointer-events: none;
}

/* ── Spotlight cutout ─────────────────────────────────────── */
.tour-spotlight-box {
  position: fixed;
  border-radius: 12px;
  pointer-events: none;
  z-index: 9001;
  /* box-shadow: dims everything outside this box */
  box-shadow:
    0 0 0 9999px rgba(0, 0, 0, 0.80),
    0 0 0 2px rgba(168, 118, 62, 0.5),
    0 0 0 4px rgba(168, 118, 62, 0.12),
    0 0 50px rgba(168, 118, 62, 0.2);
  transition:
    top    0.6s cubic-bezier(0.4, 0, 0.2, 1),
    left   0.6s cubic-bezier(0.4, 0, 0.2, 1),
    width  0.6s cubic-bezier(0.4, 0, 0.2, 1),
    height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.35s ease;
  animation: spot-breathe 3.5s ease-in-out infinite;
}

/* Spotlight gently breathes — alive, not static */
@keyframes spot-breathe {
  0%, 100% {
    box-shadow:
      0 0 0 9999px rgba(0,0,0,0.80),
      0 0 0 2px rgba(168,118,62,0.45),
      0 0 0 4px rgba(168,118,62,0.1),
      0 0 45px rgba(168,118,62,0.16);
  }
  50% {
    box-shadow:
      0 0 0 9999px rgba(0,0,0,0.80),
      0 0 0 2px rgba(168,118,62,0.75),
      0 0 0 6px rgba(168,118,62,0.18),
      0 0 70px rgba(168,118,62,0.32);
  }
}

/* Step-arrival flash — a quick bright pulse when spotlight lands */
.tour-spotlight-box.spot-arrive {
  animation: spot-arrive 0.55s ease forwards, spot-breathe 3.5s ease-in-out 0.55s infinite;
}

@keyframes spot-arrive {
  0%   { box-shadow: 0 0 0 9999px rgba(0,0,0,0.8),  0 0 0 2px rgba(168,118,62,0.4),  0 0 20px rgba(168,118,62,0.1); }
  35%  { box-shadow: 0 0 0 9999px rgba(0,0,0,0.72), 0 0 0 4px rgba(168,118,62,1),    0 0 90px rgba(168,118,62,0.55); }
  100% { box-shadow: 0 0 0 9999px rgba(0,0,0,0.8),  0 0 0 2px rgba(168,118,62,0.5),  0 0 50px rgba(168,118,62,0.2); }
}

/* ── Subtitle / narration bar ─────────────────────────────── */
.tour-subtitles {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(8,6,4,0.97) 65%, rgba(8,6,4,0.88));
  backdrop-filter: blur(10px);
  padding: 14px 28px 22px;
  z-index: 9003;
  border-top: 1px solid rgba(168,118,62,0.18);
}

.tour-sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.tour-sub-label {
  font-family: var(--mono, monospace);
  font-size: 9.5px;
  color: var(--brass, #a8763e);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 700;
}

.tour-sub-progress {
  display: flex; align-items: center; gap: 10px;
}

.tour-sub-counter {
  font-family: var(--mono, monospace);
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.05em;
}

.tour-sub-bar {
  width: 140px; height: 2px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px; overflow: hidden;
}

.tour-sub-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(30,42,74,0.8), var(--brass, #a8763e));
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}

/* Narration text — cinematic subtitle style */
.tour-sub-text {
  font-family: var(--serif, Georgia, serif);
  font-size: 16px;
  line-height: 1.7;
  color: rgba(255,255,255,0.92);
  margin: 0 0 14px;
  max-width: 820px;
  letter-spacing: 0.015em;
  min-height: 2.5em;
}

/* Typewriter cursor */
.tour-sub-text::after {
  content: '▋';
  color: var(--brass, #a8763e);
  animation: tw-blink 0.8s steps(1) infinite;
  font-size: 0.9em;
  margin-left: 2px;
  opacity: 0;
}
.tour-sub-text.typing::after { opacity: 1; }

@keyframes tw-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* Controls */
.tour-sub-controls {
  display: flex; align-items: center; gap: 8px;
  justify-content: flex-end;
}

.tour-sub-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 6px 14px;
  font-family: var(--mono, monospace);
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.tour-sub-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.tour-sub-btn-next {
  background: var(--brass, #a8763e);
  border-color: var(--brass, #a8763e);
  color: #fff; font-weight: 600; padding: 6px 22px;
}
.tour-sub-btn-next:hover { background: #c08840; border-color: #c08840; color: #fff; }

.tour-sub-btn-end {
  color: rgba(220,80,60,0.7);
  border-color: rgba(220,80,60,0.2);
}
.tour-sub-btn-end:hover {
  background: rgba(220,80,60,0.1);
  color: rgba(240,100,80,1);
  border-color: rgba(220,80,60,0.4);
}

/* ── End card ─────────────────────────────────────────────── */
.tour-end-card {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  background: var(--paper, #fffdf8);
  border-radius: 16px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  z-index: 9010;
  animation: tour-fadein 0.3s ease;
}
.tour-end-avatar {
  width: 100px; height: 100px;
  object-fit: contain; display: block;
  margin: 0 auto 16px;
  filter: drop-shadow(0 4px 12px rgba(168,118,62,0.3));
}
.tour-end-title {
  font-family: var(--serif, serif);
  font-size: 22px; font-weight: 700;
  color: var(--navy, #1e2a4a); margin: 0 0 8px;
}
.tour-end-sub {
  font-size: 13.5px;
  color: var(--ink-70, rgba(33,29,23,0.7));
  margin: 0 0 24px; line-height: 1.55;
}
.tour-end-actions { display: flex; gap: 10px; }
.tour-end-btn {
  flex: 1; padding: 10px; border-radius: 8px;
  font-family: var(--mono, monospace); font-size: 12.5px;
  cursor: pointer; transition: background 0.18s, transform 0.15s;
}
.tour-end-replay { background: var(--navy, #1e2a4a); color: #fff; border: none; }
.tour-end-replay:hover { background: var(--brass, #a8763e); transform: scale(1.02); }
.tour-end-close { background: none; border: 1px solid var(--line, rgba(33,29,23,0.12)); color: var(--ink, #211d17); }
.tour-end-close:hover { background: var(--paper-alt, #f3f0e9); }

/* ── Simulated hover on spotlighted elements ──────────────── */
/* Applied by JS via .tour-simulated-hover on experience/project cards */
.tl-entry.tour-simulated-hover,
.project-card.tour-simulated-hover,
.writing-card.tour-simulated-hover,
.hackathon-entry.tour-simulated-hover,
.zz-entry.tour-simulated-hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 12px 40px rgba(30,42,74,0.18) !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Subtle shimmer scan across spotlighted card on hover-sim */
.tour-simulated-hover::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255,255,255,0.07) 50%,
    transparent 70%
  );
  animation: tour-shimmer 1.2s ease forwards;
  pointer-events: none;
  z-index: 1;
  border-radius: inherit;
}

@keyframes tour-shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(200%); }
}

/* Blocker blackout transition */
.tour-blocker {
  transition: background 0.4s ease;
}

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 600px) {
  .tour-trigger { bottom: 16px; left: 16px; }
  .tour-intro { width: calc(100vw - 32px); left: 16px; }
  .tour-subtitles { padding: 12px 16px 18px; }
  .tour-sub-text { font-size: 14px; }
  .tour-sub-bar { width: 80px; }
  .tour-spotlight-box { border-radius: 8px; }
}
