/* ================================================================
   VoxCraft Guided Tour — overlay, spotlight, modals, tooltips
   Picture-frame spotlight: four shade rects frame the target, the
   target itself stays fully interactive with no masking tricks.
   Matches landing/styles.css oklch palette + Figtree/Cormorant.
   ================================================================ */

:root {
    --tour-shade: oklch(0 0 0 / 0.72);
    --tour-ring:  oklch(0.66 0.2 262.83);
    --tour-ring-glow: oklch(0.66 0.2 262.83 / 0.45);
    --tour-radius: 12px;
    --tour-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ----------------------------------------------------------------
   Modal — welcome + mic permission
   Full-screen dimmed backdrop with a centered card.
   ---------------------------------------------------------------- */

.tour-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: oklch(from var(--bg-dark) l c h / 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: tour-fade-in 0.3s var(--tour-ease);
    font-family: "Figtree", system-ui, sans-serif;
}

.tour-modal-backdrop.tour-visible {
    display: flex;
}

.tour-modal {
    background: var(--bg-slightly-dark);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 2.5rem 2.25rem;
    max-width: 520px;
    width: 100%;
    text-align: center;
    color: var(--text);
    position: relative;
    animation: tour-card-in 0.45s var(--tour-ease);
    box-shadow: 0 24px 64px oklch(0 0 0 / 0.4);
}

.tour-modal-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tour-ring);
    background: radial-gradient(circle, oklch(0.66 0.2 262.83 / 0.18), transparent 70%);
}

.tour-modal-eyebrow {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--tour-ring);
    font-weight: 500;
    margin-bottom: 1rem;
}

.tour-modal-title {
    font-family: "Cormorant", Georgia, serif;
    font-size: clamp(1.9rem, 4vw, 2.4rem);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 0.85rem;
}

.tour-modal-title em {
    font-style: italic;
    background: linear-gradient(135deg, oklch(0.66 0.2 262.83), oklch(0.64 0.23 300.93));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.tour-modal-body {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.55;
    margin-bottom: 1.75rem;
}

.tour-modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tour-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-sizing: border-box;
    font: inherit;
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1.2;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.25s ease;
    font-family: "Figtree", system-ui, sans-serif;
    margin-left: 0px;
}

.tour-btn-primary {
    background: oklch(0.52 0.29 261.59);
    color: white;
    box-shadow: 0 4px 24px var(--tour-ring-glow);
}
.tour-btn-primary:hover {
    background: oklch(0.46 0.27 261.59);
    transform: translateY(-1px);
}

.tour-btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
}
.tour-btn-ghost:hover {
    color: var(--text);
    border-color: var(--glass-border-hover);
}

.tour-modal-help {
    margin-top: 1.25rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}
.tour-modal-help a {
    color: var(--tour-ring);
    text-decoration: none;
}
.tour-modal-help a:hover { opacity: 0.85; }

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

/* ----------------------------------------------------------------
   Spotlight — four-shade picture frame + ring + tooltip
   ---------------------------------------------------------------- */

.tour-shade {
    position: fixed;
    background: var(--tour-shade);
    z-index: 9998;
    transition:
        top    0.35s var(--tour-ease),
        left   0.35s var(--tour-ease),
        right  0.35s var(--tour-ease),
        bottom 0.35s var(--tour-ease),
        width  0.35s var(--tour-ease),
        height 0.35s var(--tour-ease);
    pointer-events: auto;
}

.tour-ring {
    position: fixed;
    z-index: 10001;
    pointer-events: none;
    border-radius: var(--tour-radius);
    box-shadow:
        0 0 0 2px var(--tour-ring),
        0 0 24px var(--tour-ring-glow),
        0 0 48px var(--tour-ring-glow);
    transition:
        top    0.35s var(--tour-ease),
        left   0.35s var(--tour-ease),
        width  0.35s var(--tour-ease),
        height 0.35s var(--tour-ease);
    animation: tour-ring-pulse 2.4s ease-in-out infinite;
}

@keyframes tour-ring-pulse {
    0%, 100% { box-shadow: 0 0 0 2px var(--tour-ring), 0 0 24px var(--tour-ring-glow), 0 0 48px var(--tour-ring-glow); }
    50%      { box-shadow: 0 0 0 2px var(--tour-ring), 0 0 40px var(--tour-ring-glow), 0 0 80px var(--tour-ring-glow); }
}

.tour-tooltip {
    position: fixed;
    z-index: 10002;
    max-width: 320px;
    background: var(--bg-slightly-dark);
    border: 1px solid var(--glass-border);
    border-radius: var(--tour-radius);
    padding: 1.1rem 1.25rem 1rem;
    color: var(--text);
    box-shadow: 0 18px 48px oklch(0 0 0 / 0.4);
    font-family: "Figtree", system-ui, sans-serif;
    font-size: 0.93rem;
    line-height: 1.5;
    transition: top 0.35s var(--tour-ease), left 0.35s var(--tour-ease);
    animation: tour-fade-in 0.3s var(--tour-ease);
}

.tour-tooltip-eyebrow {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--tour-ring);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.tour-tooltip-title {
    font-family: "Cormorant", Georgia, serif;
    font-size: 1.3rem;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.tour-tooltip-body {
    color: var(--text-muted);
    margin-bottom: 0.85rem;
}

.tour-tooltip-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.85em;
    background: var(--code-bg);
    color: var(--code-text);
    padding: 0.1em 0.4em;
    border-radius: 4px;
}

.tour-tooltip-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.tour-tooltip-step {
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.tour-tooltip .tour-btn {
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
}

.tour-tooltip .tour-btn-ghost {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
}

.tour-tooltip-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Tooltip arrow (optional, lightweight) */
.tour-tooltip[data-placement^="top"]::after,
.tour-tooltip[data-placement^="bottom"]::after,
.tour-tooltip[data-placement^="left"]::after,
.tour-tooltip[data-placement^="right"]::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--bg-slightly-dark);
    border: 1px solid var(--glass-border);
    transform: rotate(45deg);
}
.tour-tooltip[data-placement="top"]::after    { bottom: -6px; left: 50%; margin-left: -5px; border-top: 0; border-left: 0; }
.tour-tooltip[data-placement="bottom"]::after { top: -6px;    left: 50%; margin-left: -5px; border-bottom: 0; border-right: 0; }
.tour-tooltip[data-placement="left"]::after   { right: -6px;  top: 50%;  margin-top: -5px;  border-bottom: 0; border-left: 0; }
.tour-tooltip[data-placement="right"]::after  { left: -6px;   top: 50%;  margin-top: -5px;  border-top: 0; border-right: 0; }

/* ----------------------------------------------------------------
   Practice script card — shown in the main feed area during stop 1
   ---------------------------------------------------------------- */

.tour-practice-card {
    position: relative;
    top: 1rem;
    z-index: 9999;
    background: var(--bg-slightly-dark);
    border: 1px solid oklch(from var(--primary) l c h / 0.25);
    border-radius: var(--tour-radius);
    padding: 1.75rem 2rem;
    margin: 1rem 0 2rem;
    text-align: left;
    box-shadow: 0 8px 32px oklch(0 0 0 / 0.3);
    animation: tour-card-in 0.45s var(--tour-ease);
    font-family: "Figtree", system-ui, sans-serif;
}

.tour-practice-eyebrow {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--tour-ring);
    font-weight: 500;
    margin-bottom: 0.6rem;
}

.tour-practice-title {
    font-family: "Cormorant", Georgia, serif;
    font-size: 1.6rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    margin-bottom: 1rem;
    color: var(--text);
}

.tour-practice-script {
    font-family: "Cormorant", Georgia, serif;
    font-size: 1.2rem;
    line-height: 1.55;
    font-style: italic;
    color: var(--text);
    padding: 1rem 1.25rem;
    background: oklch(from var(--bg-dark) l c h / 0.7);
    border-radius: 8px;
    border-left: 3px solid var(--tour-ring);
    margin-bottom: 1rem;
}

.tour-practice-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tour-practice-hint-arrow {
    color: var(--tour-ring);
    animation: tour-bounce 1.6s ease-in-out infinite;
}

@keyframes tour-bounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(4px); }
}

/* ----------------------------------------------------------------
   "Take the tour" re-entry button on the hero card
   ---------------------------------------------------------------- */

.hero-tour-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent;
    color: var(--tour-ring);
    border: 1px solid oklch(0.66 0.2 262.83 / 0.3);
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    margin-left: 0px;
}
.hero-tour-btn:hover {
    background: oklch(0.66 0.2 262.83 / 0.1);
    border-color: oklch(0.66 0.2 262.83 / 0.5);
}

/* ----------------------------------------------------------------
   Animations
   ---------------------------------------------------------------- */

@keyframes tour-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes tour-card-in {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .tour-shade, .tour-ring, .tour-tooltip {
        transition: none;
    }
    .tour-ring {
        animation: none;
    }
    .tour-practice-hint-arrow {
        animation: none;
    }
}

/* Mobile */
@media (max-width: 640px) {
    .tour-tooltip {
        max-width: calc(100vw - 2rem);
    }
    .tour-modal {
        padding: 2rem 1.5rem;
    }
    .tour-practice-card {
        padding: 1.25rem 1.25rem;
    }
    .tour-practice-script {
        font-size: 1.05rem;
        padding: 0.85rem 1rem;
    }
}

/* ----------------------------------------------------------------
   Quick Start tips — dynamic cards rendered into .hero-steps
   ---------------------------------------------------------------- */

.hero-tip {
    animation: tour-card-in 0.4s var(--tour-ease);
}

.hero-tip .tip-kbd {
    display: inline-block;
    padding: 0.08em 0.5em;
    background: var(--bg-light);
    border: 1px solid var(--glass-border);
    border-bottom-width: 2px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.82em;
    color: var(--text);
    line-height: 1.3;
    white-space: nowrap;
}

.hero-tip .tip-voice {
    display: inline;
    font-family: "Figtree", system-ui, sans-serif;
    font-size: 0.92em;
    font-weight: 500;
    color: var(--tour-ring);
    background: oklch(0.66 0.2 262.83 / 0.08);
    border: 1px solid oklch(0.66 0.2 262.83 / 0.2);
    padding: 0.08em 0.5em;
    border-radius: 4px;
}

/* Mirrors transcript styling: command keyword is the blue keyword pill, and
   the payload between the two keywords is the purple command-block pill. */
.hero-tip .tip-keyword,
.hero-tip .tip-command {
    display: inline;
    font-family: "Figtree", system-ui, sans-serif;
    font-size: 0.92em;
    font-weight: 500;
    padding: 0.08em 0.5em;
    border-radius: 4px;
}

.hero-tip .tip-keyword {
    color: var(--keyword-text);
    background: var(--keyword-bg);
}

.hero-tip .tip-command {
    color: var(--command-text);
    background: var(--command-bg);
}

/* Footer row — shares a baseline between "Take the tour" and the progress chip. */
.hero-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Progress indicator — tiny 2px-per-task bar + "X out of Y" label. */
.hero-progress {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}

.hero-progress-bar {
    height: 2px;
    background: var(--bg-dark);
    border-radius: 1px;
    overflow: hidden;
    flex: 0 0 auto;
}

.hero-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 1px;
    transition: width 0.4s var(--tour-ease);
}

.hero-progress-text {
    flex: 0 0 auto;
}

.hero-tips-empty {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.5rem 0.25rem;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
    animation: tour-card-in 0.4s var(--tour-ease);
}

.hero-tips-empty svg {
    flex: 0 0 auto;
    color: oklch(0.72 0.18 155);
    margin-top: 0.15rem;
}

.hero-tips-empty p {
    margin: 0;
}
